<?php
/* 
* 代售 shipped orders
 */
class AgentShippedAction extends ShippedAction {
    public function _filter(&$map) {
         parent::_filter($map);
         $map['warehouse_id'] = $_SESSION['warehouse_id'];
    }

    public function edit(){
        if($_SESSION['warehouse_id'] != $ware_id = M('Sale')->where('id='.$_REQUEST['id'])->getField('warehouse_id') )
            $this->error("对不起,该订单不属于贵公司!");
        parent::edit();
    }

    public function update(){
        if($_SESSION['warehouse_id'] != $ware_id = M('Sale')->where('id='.$_REQUEST['id'])->getField('warehouse_id') )
            $this->error("对不起,该订单不属于贵公司!");
        parent::update();
    }


}
?>
